import request from '@/utils/request'

// 查询浆纱数据汇总列表
export function listSize(query) {
  return request({
    url: '/mesana/size/list',
    method: 'get',
    params: query
  })
}

// 查询浆纱数据汇总列表
export function bancireport(query) {
  return request({
    url: '/mesana/size/bancireport',
    method: 'get',
    params: query
  })
}


export function pdtreport(query) {
  return request({
    url: '/mesana/size/pdtreport',
    method: 'get',
    params: query
  })
}



// 查询浆纱数据汇总详细
export function getSize(id) {
  return request({
    url: '/mesana/size/' + id,
    method: 'get'
  })
}

// 新增浆纱数据汇总
export function addSize(data) {
  return request({
    url: '/mesana/size',
    method: 'post',
    data: data
  })
}


// 查询当前班次和类型

export function getShiftDataAndType() {
  return request({
    url: '/mesana/warp/getShiftDataAndType/',
    method: 'get'
  })
}

// 修改浆纱数据汇总
export function updateSize(data) {
  return request({
    url: '/mesana/size',
    method: 'put',
    data: data
  })
}

// 删除浆纱数据汇总
export function delSize(id) {
  return request({
    url: '/mesana/size/' + id,
    method: 'delete'
  })
}

// 导出浆纱数据汇总
export function exportSize(query) {
  return request({
    url: '/mesana/size/export',
    method: 'get',
    params: query
  })
}

// 导出浆纱数据汇总
export function export_banci(query) {
  return request({
    url: '/mesana/size/export_banci',
    method: 'get',
    params: query
  })
}
// 查询一些初始化数据
export function getInitData() {
  return request({
    url: '/mesana/size/getInitData',
    method: 'get'
  })
}

export function getMacList(){
  return request({
    url: '/mesana/size/getMacList',
    method: 'get'
  })
}

export function getMachine(maccode) {
  return request({
    url: '/mesana/size/getMachine/' + maccode,
    method: 'get'
  })
}


// 落轴
export function luozhouoperation(id) {
  return request({
    url: '/mesana/size/luozhouoperation/' + id,
    method: 'post'
  })
}

// 从数据库找上一个轴
export function selectNewestZhou(maccode) {
  return request({
    url: '/mesana/size/selectNewestZhou/' + maccode,
    method: 'get'
  })
}

// 根据轴号查询实时长度
export function getCurlength(shaftCode){
  return request({
    url:'/mesana/size/getCurlength/' + shaftCode,
    method: 'get'
  })
}
